<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>SnappyDB</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="A fast and lightweight key/value database library for Android">
    <link href="static/bootstrap-combined.min.css" rel="stylesheet">
    <link href="static/app.css" rel="stylesheet">
    <link href="static/app-theme.css" rel="stylesheet">
    <link href="http://fonts.googleapis.com/css?family=Roboto:400,300italic,100,100italic,300" rel="stylesheet" type="text/css">
    <!--[if lt IE 9]><script src="static/html5shiv.min.js"></script><![endif]-->
  </head>
  <body data-target=".content-nav">
    <header>
      <div class="container">
        <div class="row">
          <div class="span5">
            <h1>SnappyDB</h1>
          </div>
          <div class="span7">
            <menu>
              <ul>
                <li><a href="#download" class="menu download">Download v0.4.0</a></li>
                <li><a href="http://github.com/nhachicha/SnappyDB" data-title="View GitHub Project" class="menu github"><img src="static/icon-github.png" alt="GitHub"/></a></li>
              </ul>
            </menu>
          </div>
      </div>
    </header>
    <section id="subtitle">
      <div class="container">
        <div class="row">
          <div class="span12">
          <h2>A fast and lightweight <strong>key/value database</strong> library for Android</h2>
          </div>
        </div>
      </div>
    </section>
    <section id="body">
      <div class="container">
        <div class="row">
          <div class="span9">
            <h3 id="introduction">Introduction</h3>
            
			<p>SnappyDB is a key-value database for Android it's an alternative for SQLite if you want to use a NoSQL approach.</p>

<p>It allows you to store and get primitive types, but also a Serializable object or array in a type-safe way.</p>

<p>SnappyDB can outperform SQLite in read/write operations.</p>             
            <img src="http://snappydb.com/img/benchmark_sqlite_with_transaction.png"/>
            <br/>
            <p>SnappyDB is based on <a href="https://code.google.com/p/leveldb/">leveldb</a> and use <a href="https://code.google.com/p/snappy/">snappy compression</a> algorithm, on redundant content you could achieve a good compression ratio</p>
            
            <h3 id="usage">Usage</h3>
            <p>
            <pre class="prettyprint">
try {
   DB snappydb = DBFactory.open(context); //create or open an existing databse using the default name

   snappydb.put("name", "Jack Reacher"); 
   snappydb.putInt("age", 42);  
   snappydb.putBoolean("single", true);
   snappydb.put("books", new String[]{"One Shot", "Tripwire", "61 Hours"}); 

   String   name   =  snappydb.get("name");
   int      age    =  snappydb.getInt("age");
   boolean  single =  snappydb.getBoolean("single");
   String[] books  =  snappydb.getArray("books", String.class);// get array of string

   snappydb.close();

   } catch (SnappydbException e) {
 }
            </pre>

            </p>
            
            <p>For more recipes please take a look at the <a href="https://github.com/nhachicha/SnappyDB#cookbook">Cookbook</a>.</p>
            <p><a href="https://play.google.com/store/apps/details?id=com.snappydb.snippets.app">
  <img alt="Get it on Google Play"
       src="./img/en_generic_rgb_wo_45.png" />
</a> Check out also the Demo App on The Play Store<p>
<p>With SnappyDB you could seamlessly store and retrieve your object/array, it uses <a href="https://github.com/EsotericSoftware/kryo">Kryo</a> serialization which it <a href="https://github.com/eishay/jvm-serializers/wiki">faster</a> than regular Java serialization.</p>
            
            <h3 id="download">Download</h3>

            <p><a href="https://github.com/nhachicha/SnappyDB" class="dl version-href">&darr;  SnappyDB</a></p>
            
            <p> SnappyDB uses native code for performance, it's available for the three main architecture of Android: ARM, x86 and mips.</p>
            <p>It is distributed as an <a href="http://tools.android.com/tech-docs/new-build-system/aar-format">Android Library Project</a> 
            
            <h4>Gradle</h4>



<pre class="prettyprint lang-groovy">
    dependencies {
          compile 'com.snappydb:snappydb-lib:0.4.0'
          compile 'com.esotericsoftware.kryo:kryo:2.24.0'
    }
			</pre>

			            
            <h3 id="license">License</h3>
            <p>SnappyDB is opensource, contribution and feedback are welcomed</p>
            <pre>Copyright 2013 Nabil HACHICHA.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.</pre>

<p>&copy; Nabil HACHICHA <p>

<a href="https://twitter.com/nabil_hachicha" class="twitter-follow-button" data-show-count="false">Follow @nabil_hachicha</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>

<a href="https://plus.google.com/110610526826489061446?prsrc=3"
   rel="publisher" target="_top" style="text-decoration:none;">
<img src="https://ssl.gstatic.com/images/icons/gplus-32.png" alt="Google+" style="border:0;width:32px;height:32px;"/>
</a>


          </div>
          <div class="span3">
            <div class="content-nav" data-spy="affix" data-offset-top="80">
              <ul class="nav nav-tabs nav-stacked primary">
                <li><a href="#introduction">Introduction</a></li>
                <li><a href="#usage">Usage</a></li>
                <li><a href="#download">Download</a></li>
                <li><a href="#license">License</a></li>
              </ul>
              <ul class="nav nav-pills nav-stacked secondary"><li><img data-src="holder.js/200x200" src="http://snappydb.com/img/snappydb_logo.jpg" class="img-thumbnail" alt="200x200" style="width: 200px; height: 200px;"></li></ul>
            </div>
          </div>
        </div>
        
    </section>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="static/bootstrap.min.js"></script>
    <script src="static/jquery.smooth-scroll.min.js"></script>
    <script src="static/jquery-maven-artifact.min.js"></script>
    <script src="static/prettify.js"></script>
    <script type="text/javascript">
      $(function() {
        // Syntax highlight code blocks.
        prettyPrint();

        // Spy on scroll position for real-time updating of current section.
        $('body').scrollspy();
        
        // Use smooth-scroll for internal links.
        $('a').smoothScroll();

        // Enable tooltips on the header nav image items.
        $('.menu').tooltip({
          placement: 'bottom',
          trigger: 'hover',
          container: 'body',
          delay: {
            show: 500,
            hide: 0
          }
        });

        
      });
    </script>



<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-46289772-1', 'snappydb.com');
  ga('send', 'pageview');

</script>

  </body>
</html>
